import { defineStore } from 'pinia'
import api from '@/services/api/memo'
import { useMemoStore } from '@/stores/memoStore'
export const advices = defineStore('advices', {
	state: () => ({
		advices: []
	}),
	actions: {
		async getAdvices() {
			await useMemoStore().getUserId()
			const id = useMemoStore().id
			const { data: res } = await api.getAdvices(id)
			console.log(res)
			this.advices = res.taskAndAdvice
			// console.log(this.advices)
			// console.log("第一个元素:", this.advices[0]);
		}
	}
})